package net.sk.china.city.mapper;

import java.util.List;
import net.sk.china.city.domain.ArInventory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 商品库存Mapper接口
 * 
 * @author gxf
 * @date 2024-03-27
 */
@Mapper
public interface ArInventoryMapper extends BaseMapper<ArInventory>
{
    /**
     * 查询商品库存
     * 
     * @param id 商品库存主键
     * @return 商品库存
     */
    public ArInventory selectArInventoryById(Long id);

    /**
     * 查询商品库存列表
     * 
     * @param arInventory 商品库存
     * @return 商品库存集合
     */
    public List<ArInventory> selectArInventoryList(ArInventory arInventory);

    /**
     * 新增商品库存
     * 
     * @param arInventory 商品库存
     * @return 结果
     */
    public int insertArInventory(ArInventory arInventory);

    /**
     * 修改商品库存
     * 
     * @param arInventory 商品库存
     * @return 结果
     */
    public int updateArInventory(ArInventory arInventory);

    /**
     * 删除商品库存
     * 
     * @param id 商品库存主键
     * @return 结果
     */
    public int deleteArInventoryById(Long id);

    /**
     * 批量删除商品库存
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteArInventoryByIds(Long[] ids);

    @Select("select * from ar_inventory where pro_code = #{proCode} and inventory_flag is null")
    ArInventory selectInventoryByProCode(String proCode);

    @Select("select * from ar_inventory where pro_code = #{proCode} and inventory_flag = '1' ")
    ArInventory selectAddInventoryByProCode(String proCode);
}
